package com.zr.controller.intelligent;


import com.zr.service.intelligent.TransitPathService;
import com.zr.utils.AjaxResult;

import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author 陈鹏
 */
@RestController
@RequestMapping("/transitPath")
public class TransitPathController {

    @Resource
    private TransitPathService transitPathService;

    /**
     * 获取从一个地点出发途径列表各点返回原点最短路径
     *
     * @param cityIds
     * @return
     * @author 陈鹏
     */
    @RequestMapping("/getShortestPath")
    public AjaxResult getShortestPath(@RequestBody List<Integer> cityIds) {
        Map<String, Object> map = new HashMap<>();
        map = transitPathService.getShortestPath(cityIds);
        return AjaxResult.success(200, "查询成功", map);
    }
}
